package com.flnet.spsys.controller;


import com.flnet.spsys.entity.TbProject;
import com.flnet.spsys.service.ITbProjectService;
import com.flnet.spsys.service.ITbWorksService;
import com.flnet.spsys.utils.ResultJson;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Qu Jingbin
 * @since 2021-03-15
 */
@RestController
@RequestMapping("/tb-project")
public class TbProjectController extends BaseController {
    @Autowired
    private ITbProjectService iTbProjectService;


    @ApiOperation(value = "项目信息",notes = "获取项目信息")
    @ApiResponses(
            @ApiResponse(code = 200,message = "获取成功",response = ResultJson.class)
    )
    @ResponseBody
    @PostMapping("/info")
    @CrossOrigin
    public Object getProjectInfo(){
        List<TbProject> tbProjectList = iTbProjectService.list();
        if(tbProjectList == null){
            return "获取失败！";
        }
        return ResultJson.success(tbProjectList);
    }

}
